﻿using System.Collections.Generic;

namespace Microsoft.Practices.CompositeUI.UIElements
{
    /// <summary>
    /// 	Catalog that keeps track of what factories are available.
    /// </summary>
    public interface IUIElementAdapterFactoryCatalog
    {
        /// <summary>
        /// 	Dictionary of the availble factories.
        /// </summary>
        IList<IUIElementAdapterFactory> Factories
        {
            get;
        }

        /// <summary>
        /// 	Retrieves a factory for the given UI element.
        /// </summary>
        /// <param name = "uiElement">The UI element to lookup a factory for.</param>
        /// <returns>A factory to use to create <see cref = "IUIElementAdapter" /> for the UI element.</returns>
        IUIElementAdapterFactory GetFactory(object uiElement);

        /// <summary>
        /// 	Adds an entry in the factories dictionary.
        /// </summary>
        /// <param name = "factory">The factory to register with the catalog.</param>
        void RegisterFactory(IUIElementAdapterFactory factory);
    }
}